package subject_set.interview.Day3_28_baidu;

/**
 * @author haomin
 * @date 2023/03/28 20:54
 **/
import java.util.*;

public class Main {
    public static void main(String[] args) {
        String str = "Baidu";
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {// 注意，如果输入是多个测试用例，请通过while循环处理多个测试用例
            int n = Integer.parseInt(in.nextLine().trim());
            for (int i = 0; i < n; ++i) {
                String ret = in.nextLine().trim();
                int[] arr = new int[125];
                for (char c : ret.toCharArray()) {
                    arr[c]++;
                }
                if (arr['B'] == 1 && arr['a'] == 1 && arr['i'] == 1 && arr['d'] == 1 && arr['u'] == 1)
                    System.out.println("Yes");
                else System.out.println("No");
            }
        }
    }
}